<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

	<link rel="stylesheet" type="text/css" href="<%=path%>/jsplug/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=path%>/jsplug/easyui/themes/icon.css">
<%-- 	<link rel="stylesheet" type="text/css" href="<%=path%>/jsplug/easyui/demo/demo.css"> --%>
	<script type="text/javascript" src="<%=path%>/js/jquery.min.js"></script>
	<script type="text/javascript" src="<%=path%>/jsplug/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="<%=path%>/js/mytree.js"></script>
</head>
<body >
<!-- 	<div style="width:600px;margin: 0 auto;margin-top:10px;"> -->
		<div id="treeDiv" style="float:left; width:600px;">
			<ul id="tree1" ></ul>
		</div>
		
<!-- 		<div id="testDiv" style="float:left;margin-left:5%;"> -->
<!-- 			<textarea id="custom_mapping" rows="0" cols="30%" style="display: none"></textarea> -->
<!-- 		</div>	 -->
<!-- 	</div> -->
	<script type="text/javascript">
		$(function(){
			$.ajax({
		        url:"<%=path%>/Config_loadConfig?configName=<%=request.getParameter("file")%>",
		        type: 'post',
		        dataType: 'xml',
		        timeout: 3000,
		        error: function(){
		            alert('加载数据失败...');
		        },
		        success:function(xml){
// 		        	xml 指定显示node树结构
					var tree1 = $("#tree1");
					loadXmlNodeToTree(tree1, $(xml).children(), ["name"]);
					tree1.tree({
						onClick: function(node){
								$("#custom_mapping").val($("#custom_mapping").val() + "=" + node.text);
								$("#custom_mapping").focus();
						}
					});
					tree1.tree("collapseAll");
// 					$("#custom_mapping").css("height",$("#tree1").css("height"));
// 					$("#custom_mapping").show();
				}
		    });
		});
		function setFocus(){ //文本末尾获得焦点
			var obj = event.srcElement;
			var txt =obj.createTextRange();
			txt.moveStart('character',obj.value.length);
			txt.collapse(true);
			txt.select();
		} 
	</script>
	
</body>
</html>